import request from '@/utils/request'

// 查询账号融资列表
export function listTradefinancing(query) {
  return request({
    url: '/business/tradefinancing/list',
    method: 'get',
    params: query
  })
}

// 查询账号融资详细
export function getTradefinancing(id) {
  return request({
    url: '/business/tradefinancing/' + id,
    method: 'get'
  })
}

// 新增账号融资
export function addTradefinancing(data) {
  return request({
    url: '/business/tradefinancing',
    method: 'post',
    data: data
  })
}

// 修改账号融资
export function updateTradefinancing(data) {
  return request({
    url: '/business/tradefinancing',
    method: 'put',
    data: data
  })
}

// 删除账号融资
export function delTradefinancing(id) {
  return request({
    url: '/business/tradefinancing/' + id,
    method: 'delete'
  })
}

//还本
export function repaymentofprincipal(data) {
  debugger
  return request({
    url: '/business/tradefinancing/repayment',
    method: 'post',
    data: data
  })
}

//还息
export function payInterest(data) {
  debugger
  return request({
    url: '/business/tradefinancing/payInterest',
    method: 'post',
    data: data
  })
}